import java.time.LocalDateTime;
class Admin extends User {
    public Admin(String userId, String username, String password,
                 LocalDateTime registerTime, String phoneNumber) {
        super(userId, username, password, registerTime, phoneNumber, "admin");
    }
    @Override
    public boolean changePassword(String oldPassword, String newPassword) {
        if (this.password.equals(oldPassword)) {
            this.password = newPassword;
            Logger.log("修改管理员密码", this.username);
            return true;
        }
        return false;
    }
    public boolean resetUserPassword(User user) {
        if (!user.getUserType().equals("admin")) {
            user.setPassword("123456");
            Logger.log("重置" + user.getUserType() + " " + user.getUsername() + "的密码", this.username);
            return true;
        }
        return false;
    }
}
